home *** CD-ROM | disk | FTP | other *** search
- Path: lrz-muenchen.de!news
- From: watzka@stat.uni-muenchen.de (Kurt Watzka)
- Newsgroups: comp.lang.c
- Subject: Re: String Question
- Date: 16 Mar 1996 11:38:43 GMT
- Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
- Distribution: world
- Message-ID: <4ie983$3v0@sparcserver.lrz-muenchen.de>
- References: <DoBt0E.4A9@freenet.carleton.ca>
- NNTP-Posting-Host: sun2.lrz-muenchen.de
-
- aq436@FreeNet.Carleton.CA (Jerry Boyd) writes:
-
- >
- >How would I write a function to remove a specified
- >number of characters from a string and store it in an array.
-
- If you want to take part in the annual "reinvent the wheel" contest,
- by copying a specified ...
-
- Otherwise, use strncpy(), but don't forget to hav a look at the
- documentation for that function from the standard C library
- first.
-
- >For instance, extracting three characters from a string, starting
- >from the 5th character.
-
- strncpy(dest, src + 5, 3);
-
- Kurt
- --
- | Kurt Watzka Phone : +49-89-2180-6254
- | watzka@stat.uni-muenchen.de
- | ua302aa@sunmail.lrz-muenchen.de
-